package vista;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.layout.VerticalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.SimpleWindow;
import org.uqbar.arena.windows.WindowOwner;

public class MenuPrincipalWindow extends SimpleWindow<Object> {

	private static final long serialVersionUID = 1L;

	public MenuPrincipalWindow(WindowOwner parent) {
		super(parent,new Object());
	}
	
	@Override
	protected void createMainTemplate(Panel mainPanel) {
		this.setTitle("Menu Principal");
		this.setTaskDescription("Elija que hacer");
		super.createMainTemplate(mainPanel);
	}

	@Override
	protected void createFormPanel(Panel mainPanel) {
		mainPanel.setLayout(new VerticalLayout());
	}

	@Override
	protected void addActions(Panel actionsPanel) {
		actionsPanel.setLayout(new VerticalLayout());
		
		new Button(actionsPanel)
		.setCaption("Ver empleados")
		.onClick(new MessageSend(this, "verEmpleados"));
		
		new Button(actionsPanel)
		.setCaption("Ver excepciones")
		.onClick(new MessageSend(this, "verExcepciones"));
		
		new Button(actionsPanel)
		.setCaption("Ver planificaciones semanales")
		.onClick(new MessageSend(this, "verPlanificaciones"));		
	}

	public void verEmpleados(){
		new EmpleadosWindow(this).open();
	}
	
	public void verExcepciones(){
		new ExcepcionesWindow(this).open();
	}
	
	public void verPlanificaciones(){
		//TODO descomentar cuando se cree la vista de planificaciones
		new ListadoPlanificacionesWindow(this).open();
	}
	
	
	

}
